class Solution
{
public:
    bool isPalindrome(int x) {
        if(!x) return true;
        if(x<0 || x%10==0) return false;
        int y = 0, t;
        while(y<x) {
            t = x%10;
            x = x/10;
            if(x == y) return true;
            y = y*10+t;
        }
        return x==y;
    }
};
